package com.lovo.cloud.controller;

import com.lovo.cloud.model.dto.TicketDTO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author luo
 * @description
 * @date 2020/11/30 20:03
 */
@RestController
public class MeiTuanController {

    @Resource
    public RestTemplate restTemplate;

    @PostMapping("/sale")
    public String sale(@RequestBody TicketDTO ticketDTO){
        return restTemplate.postForObject("http://localhost:8001/cinema",ticketDTO,String.class);
    }

}
